package com.ruoyi.labsafety.domain;

import java.util.Date;
import java.util.List;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.labdata.domain.LabFile;
import com.ruoyi.labdata.domain.LabFlowInstance;

/**
 * 安全检查任务对象 lab_safety_check_task
 * 
 * @author jun.wang
 * @date 2022-04-25
 */
public class LabSafetyCheckTask extends LabFlowInstance
{
    private static final long serialVersionUID = 1L;
    /**
     * 危化品采购业务类型.
     */
    private static final String businessTypeOpt = "safetyCheckTask";

    public LabSafetyCheckTask() {
        super.setBusinessTypeOpt(businessTypeOpt);
    }

    /** 安检类型 */
    @Excel(name = "安检类型")
    private String safetyCheckOpt;
    
    public String getApplyScope(){
    	if(this.safetyCheckOpt==null){
    		return null;
    	}
    	if(Integer.valueOf(this.safetyCheckOpt)<=3){
    		return "university";
    	}else{
    		return "academy";
    	}
    }

    /** 安检模板 */
    @Excel(name = "安检模板")
    private String safetyTemplateOpt;

    /** 任务周期 */
    @Excel(name = "任务周期")
    private String taskCycleOpt;

    /** 周期频次 */
    @Excel(name = "周期频次")
    private String checkFrequencyOpt;

    /** 任务开始 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "任务开始", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startDate;

    /** 任务结束 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "任务结束", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endDate;

    /** 整改报告 */
    @Excel(name = "整改报告")
    private String rectificationTypeOpt;

    /** 整改期限 */
    @Excel(name = "整改期限")
    private Long rectificationPeriod;

    /** 任务详情 */
    @Excel(name = "任务详情")
    private String taskDescription;

    /** 发起机构部门 */
    @Excel(name = "发起机构部门")
    private Long createOrgId;

    /** 任务状态 */
    @Excel(name = "任务状态")
    private String status;

    /** 复核人员 */
    @Excel(name = "复核人员")
    private String reviewUsers;

    /** 实验室ID */
    @Excel(name = "实验室ID")
    private Long orgId;
    
    private String labCode;
    
    private String rooms;
    
    private String correctiveMark;
    
    private String correctiveNo;
    

    public String getRooms() {
		return rooms;
	}

	public void setRooms(String rooms) {
		this.rooms = rooms;
	}

	public String getCorrectiveMark() {
		return correctiveMark;
	}

	public void setCorrectiveMark(String correctiveMark) {
		this.correctiveMark = correctiveMark;
	}

	public String getCorrectiveNo() {
		return correctiveNo;
	}

	public void setCorrectiveNo(String correctiveNo) {
		this.correctiveNo = correctiveNo;
	}

	public String getLabCode() {
		return labCode;
	}

	public void setLabCode(String labCode) {
		this.labCode = labCode;
	}

	/** 安全检查表单ID */
    @Excel(name = "安全检查表单ID")
    private Long checkFormId;

    /** 检查人员 */
    @Excel(name = "检查人员")
    private Long checkUserId;

    /** 检查人名称 */
    @Excel(name = "检查人名称")
    private String checkUserName;

    /** 类型（1-检查任务， 2-整改任务） */
    private Integer type;

    // 安检模板列表
    private String[] safetyTemplateOptArray;

    // 安检数据列表
    private List<LabSafetyCheckIndex> labSafetyCheckIndexList;

    // 安检数据列表
    private List<LabSafetyCheckTaskIndexItem> indexItemList;

    // 附件
    private List<LabFile> files;

    private Long loginUserId;

    public Long getLoginUserId() {
        return loginUserId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
        if(this.type!=null && this.type ==2){
    		super.setBusinessTypeOpt("safetyRectify");
    	}else{
    		super.setBusinessTypeOpt(businessTypeOpt);
        }
    }

    public void setLoginUserId(Long loginUserId) {
        this.loginUserId = loginUserId;
    }

    public void setSafetyCheckOpt(String safetyCheckOpt)
    {
        this.safetyCheckOpt = safetyCheckOpt;
    }

    public String getSafetyCheckOpt() 
    {
        return safetyCheckOpt;
    }
    public void setSafetyTemplateOpt(String safetyTemplateOpt) 
    {
        this.safetyTemplateOpt = safetyTemplateOpt;
    }

    public String getSafetyTemplateOpt() 
    {
        return safetyTemplateOpt;
    }
    public void setTaskCycleOpt(String taskCycleOpt) 
    {
        this.taskCycleOpt = taskCycleOpt;
    }

    public String getTaskCycleOpt() 
    {
        return taskCycleOpt;
    }
    public void setCheckFrequencyOpt(String checkFrequencyOpt) 
    {
        this.checkFrequencyOpt = checkFrequencyOpt;
    }

    public String getCheckFrequencyOpt() 
    {
        return checkFrequencyOpt;
    }
    public void setStartDate(Date startDate) 
    {
        this.startDate = startDate;
    }

    public Date getStartDate() 
    {
        return startDate;
    }
    public void setEndDate(Date endDate) 
    {
        this.endDate = endDate;
    }

    public Date getEndDate() 
    {
        return endDate;
    }
    public void setRectificationTypeOpt(String rectificationTypeOpt) 
    {
        this.rectificationTypeOpt = rectificationTypeOpt;
    }

    public String getRectificationTypeOpt() 
    {
        return rectificationTypeOpt;
    }
    public void setRectificationPeriod(Long rectificationPeriod) 
    {
        this.rectificationPeriod = rectificationPeriod;
    }

    public Long getRectificationPeriod() 
    {
        return rectificationPeriod;
    }
    public void setTaskDescription(String taskDescription) 
    {
        this.taskDescription = taskDescription;
    }

    public String getTaskDescription() 
    {
        return taskDescription;
    }
    public void setCreateOrgId(Long createOrgId) 
    {
        this.createOrgId = createOrgId;
    }

    public Long getCreateOrgId() 
    {
        return createOrgId;
    }
    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }
    public void setReviewUsers(String reviewUsers) 
    {
        this.reviewUsers = reviewUsers;
    }

    public String getReviewUsers() 
    {
        return reviewUsers;
    }
    public void setOrgId(Long orgId) 
    {
        this.orgId = orgId;
    }

    public Long getOrgId() 
    {
        return orgId;
    }
    public void setCheckFormId(Long checkFormId) 
    {
        this.checkFormId = checkFormId;
    }

    public Long getCheckFormId() 
    {
        return checkFormId;
    }
    public void setCheckUserId(Long checkUserId) 
    {
        this.checkUserId = checkUserId;
    }

    public Long getCheckUserId() 
    {
        return checkUserId;
    }

    public String getCheckUserName() {
        return checkUserName;
    }

    public void setCheckUserName(String checkUserName) {
        this.checkUserName = checkUserName;
    }

    public String[] getSafetyTemplateOptArray() {
        return safetyTemplateOptArray;
    }

    public void setSafetyTemplateOptArray(String[] safetyTemplateOptArray) {
        this.safetyTemplateOptArray = safetyTemplateOptArray;
    }

    public List<LabSafetyCheckTaskIndexItem> getIndexItemList() {
        return indexItemList;
    }

    public void setIndexItemList(
        List<LabSafetyCheckTaskIndexItem> indexItemList) {
        this.indexItemList = indexItemList;
    }

    public List<LabFile> getFiles() {
        return files;
    }

    public void setFiles(List<LabFile> files) {
        this.files = files;
    }

    public List<LabSafetyCheckIndex> getLabSafetyCheckIndexList() {
        return labSafetyCheckIndexList;
    }

    public void setLabSafetyCheckIndexList(
        List<LabSafetyCheckIndex> labSafetyCheckIndexList) {
        this.labSafetyCheckIndexList = labSafetyCheckIndexList;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("instanceId", getInstanceId())
            .append("createTime", getCreateTime())
            .append("createBy", getCreateBy())
            .append("safetyCheckOpt", getSafetyCheckOpt())
            .append("safetyTemplateOpt", getSafetyTemplateOpt())
            .append("taskCycleOpt", getTaskCycleOpt())
            .append("checkFrequencyOpt", getCheckFrequencyOpt())
            .append("startDate", getStartDate())
            .append("endDate", getEndDate())
            .append("rectificationTypeOpt", getRectificationTypeOpt())
            .append("rectificationPeriod", getRectificationPeriod())
            .append("taskDescription", getTaskDescription())
            .append("createOrgId", getCreateOrgId())
            .append("status", getStatus())
            .append("reviewUsers", getReviewUsers())
            .append("orgId", getOrgId())
            .append("checkFormId", getCheckFormId())
            .append("checkUserId", getCheckUserId())
            .toString();
    }
}
